/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package technotheist.geo.map.scalar;

import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import technotheist.geo.map.AIntMap;
import technotheist.geo.map.Format;

/**
 *
 * @author Mitchel Strachan
 */
public class IntMap extends AIntMap<IntBuffer> {

    final IntBuffer data;
    
    
    

    public IntMap(int sideLength, boolean normalized) {
        this(sideLength, 1, normalized);
    }

    public IntMap(int sideLength, int components, boolean normalized) {
        super(sideLength, components, Format.Int, normalized);
        this.data = ByteBuffer.allocateDirect(byteCount).asIntBuffer();
    }


    @Override
    protected IntBuffer data() {
        return data;
    }

    @Override
    public int getInt(int bufferIndex) {
        return data.get(bufferIndex);
    }

    @Override
    public void setInt(int bufferIndex, int value) {
        data.put(bufferIndex, value);
    }
}
